//
//  BYSCover.m
//  彩票项目
//
//  Created by 白岩凇 on 16/9/19.
//  Copyright © 2016年 白岩凇. All rights reserved.
//

#import "BYSCover.h"

@implementation BYSCover

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

+ (void)show{
    //创造这个cover
    BYSCover* cover= [[self alloc]init];
    cover.backgroundColor=[UIColor blackColor];
    cover.alpha=0.6;
    cover.frame=[[UIScreen mainScreen] bounds];
    //添加到主窗口
    [[[UIApplication sharedApplication] keyWindow] addSubview:cover];
    
}
+ (void)hidden{
    //从所有的view中找到这个类的对象，移除
    for (UIView* childView in [[UIApplication sharedApplication] keyWindow].subviews) {
        if ([childView isKindOfClass:self]) {
            [childView removeFromSuperview];
        }
    }
}

@end
